-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1808973: azurerm terraform fixes for address_prefixes #1
Bug 1808973: azurerm terraform fixes for address_prefixes #1
Conversation
@jhixson74: This pull request references Bugzilla bug 1808973, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
azurerm/internal/services/network/resource_arm_virtual_network.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/network/resource_arm_virtual_network.go
Outdated
Show resolved
Hide resolved
also would be nice to include tests that will be helpful when we take this patch upstream |
a6bcb82
to
5514c36
Compare
I've added tests. I have no idea how to actually run them right now, but in theory they should work ;-) |
John here are the docs for testing https://github.com/terraform-providers/terraform-provider-azurerm#developing-the-provider |
5514c36
to
e919f9b
Compare
dca947c
to
5ccd5e9
Compare
I have updated the tests. They currently fail with: Error: Error Creating/Updating Virtual Network "acctestvirtnet200313092520435843" (Resource Group "acctestRG-200313092520435843"): network.VirtualNetworksClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="SubscriptionNotRegisteredForFeature" Message="Subscription XXX is not registered for feature Microsoft.Network/AllowMultipleAddressPrefixesOnSubnet required to carry out the requested operation." Details=[] This seems to be an issue with our subscription and not a logic issue. |
azurerm/internal/services/network/tests/resource_arm_virtual_network_test.go
Show resolved
Hide resolved
This is looking good except the comment #1 (comment) |
The azure subnet resource allows for multiple address prefixes using the address_prefixes argument. The virtual network resource allows inline subnets, but does not currently support this argument. When the address_prefixes argument is used, address_prefix will be null when terraform refreshes its state causing terraform to panic. This code updates the virtual network resource to allow address_prefixes to be used and for address_prefix to be null. Tests have been added to test the multiple prefixes. The magic number in the new tests is the same magic number used in the other VNet tests. I'm not 100% clear on this number, but it appears to be a known ID. It's origin is documented (not very well) here: hashicorp#1913 This fix addresses the following bugs: https://bugzilla.redhat.com/show_bug.cgi?id=1805251 https://bugzilla.redhat.com/show_bug.cgi?id=1808973 https://bugzilla.redhat.com/show_bug.cgi?id=1805936 https://bugzilla.redhat.com/show_bug.cgi?id=1808969
The azure load balancer resource's frontend_ip_configuration argument assumes the IP address is only going to be IPv4. This removes that restriction to be in line with the rest of the terraform code that does not have that validation. https://bugzilla.redhat.com/show_bug.cgi?id=1808973
5ccd5e9
to
aacd63a
Compare
Commit message has been updated to explain this value. |
@jhixson74: This pull request references Bugzilla bug 1808973, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@jhixson74: All pull requests linked via external trackers have merged. Bugzilla bug 1808973 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
…sku-update Updated to include TRIAL as a SKU
Add network interface and security group association
…ent-path-validation Update path validation for api management api
When a subnet uses address_prefixes, address_prefix is null in the virtual network resource. Add address_prefixes to virtual network resource and allow null for address_prefix. Don't assume IPv4 for private_ip_address on load balancer resource.
https://bugzilla.redhat.com/show_bug.cgi?id=1805251
https://bugzilla.redhat.com/show_bug.cgi?id=1808973
https://bugzilla.redhat.com/show_bug.cgi?id=1805936
https://bugzilla.redhat.com/show_bug.cgi?id=1808969